Make the wizard dashboard runtime-configurable - #167
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Reviewer: matt-pocock (TypeScript/JS-focused — this PR is a pure JS refactor moving hardcoded config into wizard.json).
Overall the data-driven refactor is clean: wizard-config.js is small and well-tested, patterns.js/summary.js correctly thread the new wizardConfig param through, and vite.config.js correctly emits wizard.json as a build asset. Left one actionable inline comment on src/js/ui.js about an unhandled-rejection gap in initWizard where a failed patterns_url/engines_url load (unlike a failed configUrl load) has no user-visible fallback. No other blocking issues found in the diff.
Generated by Specialist PR Review for #167 · auto · 49.6 AIC · ⌖ 1.74 AIC · ⊞ 7.9K
| const ready = loadWizardConfig(configUrl).catch(() => { | ||
| return null; | ||
| }).then((config) => { | ||
| if (!config) { | ||
| const container = document.getElementById('archetype-options'); | ||
| if (container) { | ||
| container.setAttribute('role', 'status'); | ||
| container.textContent = 'Unable to load the wizard configuration.'; | ||
| } | ||
| return null; | ||
| } | ||
| wizardConfig = config; | ||
| const patternsUrl = resolveWizardAssetUrl(config.patterns_url, configUrl); | ||
| const enginesUrl = resolveWizardAssetUrl(config.engines_url, configUrl); | ||
| return Promise.all([ | ||
| loadPatterns(patternsUrl), | ||
| loadDefinitionEngines(opts.fetch, enginesUrl) | ||
| ]); |
There was a problem hiding this comment.
The loadWizardConfig(...).catch(...) only guards the config fetch. If loadPatterns(patternsUrl) or loadDefinitionEngines(...) reject (e.g. wizard.json loads but patterns_url/engines_url is unreachable or 404s), the returned ready promise rejects with no .catch, producing an unhandled rejection and leaving the UI in the "loading" state with no user-visible error — unlike the config-load failure path just above, which does show "Unable to load the wizard configuration.". Consider wrapping this Promise.all(...) (or the whole chain) in a .catch that surfaces the same kind of status message, so a broken patterns_url/engines_url fails as gracefully as a broken configUrl.
|
@copilot also allow to configure the text content of the landing page items, button, footer URLs |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in db67bc5. Restored the curated archetype safeguards required by the prompt-generation tests; all 196 tests and the build now pass. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in 88c065f. |
The wizard’s content and presentation were embedded in JavaScript and HTML, preventing reuse outside this repository. This change moves customization into a runtime JSON contract.
Changes
Runtime configuration
wizard.jsonfor choices, summaries, archetype ordering, recommendations, and data endpoints.Data-driven rendering
Third-party integration
initWizard({ configUrl }).